package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.notice;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.notice.NoticeService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author: YangYu
 * @ClassName: NoticeController
 * @Date: Created in 14:05 2022/7/12
 * @Description: 通知模块
 */
@Action
@RequestMapping(value="notice/notice")
public class NoticeController extends BaseController {

    @Resource
    private NoticeService noticeService;

    /**
     * @Author YangYu
     * @Description 通知组分页列表
     * @Date Created in 14:09 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeGroupListPage", method = RequestMethod.GET, param = { "page","limit" })
    public RespEntity noticeGroupListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeGroupListPage(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 通知组新增、编辑
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeGroupAddOrUpdate", method = RequestMethod.POST)
    public RespEntity noticeGroupAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeGroupAddOrUpdate(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 通知组删除
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeGroupDel", method = RequestMethod.POST, param = { "id" })
    public RespEntity noticeGroupDel(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeGroupDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 联系人分页列表
     * @Date Created in 14:21 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeContactsListPage", method = RequestMethod.GET, param = { "page","limit" })
    public RespEntity noticeContactsListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeContactsListPage(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 联系人新增、编辑
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeContactsAddOrUpdate", method = RequestMethod.POST)
    public RespEntity noticeContactsAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeContactsAddOrUpdate(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 联系人删除
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeContactsDel", method = RequestMethod.POST, param = { "id"})
    public RespEntity noticeContactsDel(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeContactsDel(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 组内联系人分页列表
     * @Date Created in 14:21 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeGroupContactsListPage", method = RequestMethod.GET, param = { "page","limit" })
    public RespEntity noticeGroupContactsListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeGroupContactsListPage(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 联系人绑定分组
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeGroupContactsAdd", method = RequestMethod.POST, param = { "groupId","contactsId"})
    public RespEntity noticeGroupContactsAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeGroupContactsAdd(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 组内删除联系人
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */
    @At(value = "noticeGroupContactsDel", method = RequestMethod.POST, param = { "groupId","contactsId"})
    public RespEntity noticeGroupContactsDel(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeGroupContactsDel(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 短信语音通知
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */
    @At(value = "sMSVoiceNotice", method = RequestMethod.POST)
    public RespEntity sMSVoiceNotice(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.sMSVoiceNotice(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 信息回复
     * @Date Created in 11:16 2022/7/15
     * @Param [jsonParam]
     */

    @At(value = "messageReply", method = RequestMethod.POST)
    public RespEntity messageReply(HttpServletRequest request) {
        return noticeService.messageReply();
    }

    /**
     * @Author YangYu
     * @Description 记录分页列表
     * @Date Created in 14:21 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "noticeRecordListPage", method = RequestMethod.GET, param = { "page","limit" })
    public RespEntity noticeRecordListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.noticeRecordListPage(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 更新短信、语音状态（云智信）
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */
    @At(value = "updateStateYZX", method = RequestMethod.POST)
    public RespEntity updateStateYZX(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.updateStateYZX(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 短信、语音余量列表
     * @Date Created in 14:21 2022/7/12
     * @Param [jsonParam]
     */

    @At(value = "smsVoiceMarginList", method = RequestMethod.GET, param = { "homeId" })
    public RespEntity smsVoiceMarginList(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.smsVoiceMarginList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 短信语音余量新增、编辑
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */
    @At(value = "addOrUpdate", method = RequestMethod.POST)
    public RespEntity addOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.addOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 批量插入单位短信、语音使用条数
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */
    @At(value = "setBusinessCount", method = RequestMethod.POST)
    public RespEntity setBusinessCount(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.setBusinessCount(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 注册短信验证码
     * @Date Created in 14:16 2022/7/12
     * @Param [jsonParam]
     */
    @At(value = "register", method = RequestMethod.POST)
    public RespEntity register(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeService.register(jsonParam);
    }

}
